function sendRequest() {
  const xhr = new XMLHttpRequest()
  xhr.open('GET', 'http://127.0.0.1/api/get?name=张智琦&age=18')
  xhr.onreadystatechange = () => {
    if (xhr.readyState === XMLHttpRequest.DONE) {
      if (xhr.status === 200) {
        const res = xhr.response
        console.log(res)
      }
    }
  }
  xhr.send()
}
